<?php

namespace app\api\service;
use think\helper\Str;

class Token {

  public static function get($userId) {
    $rand = Str::random(15);
    $token = md5($userId . $rand . time());
    return $token;
  }

  public static function verify($token) {
    return cache($token);
  }

}